import axios, { AxiosResponse } from "axios";

export async function post<T>(url: string, data: any): Promise<AxiosResponse<T>> {
    return await axios.post(url, data, {
        headers: {
            "Content-Type": "application/json"
        }
    });
}

export async function postAuth<T>(
    url: string,
    data: any,
    token: string
): Promise<AxiosResponse<T>> {
    return await axios.post(url, data, {
        headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${token}`
        }
    });
}
